Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setting.AppPath for integration tests #1923

Merged
merged 2 commits into from
Jun 13, 2017

Conversation

ethantkoenig
Copy link
Member

Fixes #1910.

@typeless, please confirm this fixes the issue.

@lunny lunny added the type/bug label Jun 10, 2017
@lunny lunny added this to the 1.2.0 milestone Jun 10, 2017
@lunny
Copy link
Member

lunny commented Jun 10, 2017

@ethantkoenig It seems it's not fixed.

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 10, 2017
@ethantkoenig
Copy link
Member Author

ethantkoenig commented Jun 10, 2017

@lunny How so? When I run with my changes locally, I get the following hook in hooks/pre-receive.d/gitea:

#!/usr/bin/env bash
"/home/ethantkoenig/.gopath/src/code.gitea.io/gitea/gitea" hook --config='integrations/mysql.ini' pre-receive

@ethantkoenig
Copy link
Member Author

Fix so that the --config flag is given as an absolute path; now hooks/pre-receive.d/gitea is

#!/usr/bin/env bash
"/home/ethantkoenig/.gopath/src/code.gitea.io/gitea/gitea" hook --config='/home/ethantkoenig/.gopath/src/code.gitea.io/gitea/integrations/mysql.ini' pre-receive

@typeless
Copy link
Contributor

@ethantkoenig It doesn't seem to work.

 ~/w/go/code.gitea.io/gitea  ⑂ pr1923 +    ./tt.sh PullMerge
2017/06/10 12:15:55 [T] Custom path: /Users/mura/w/go/code.gitea.io/gitea/custom
2017/06/10 12:15:55 [T] Log path: /Users/mura/w/go/code.gitea.io/gitea/log
2017/06/10 12:15:55 [I] Gitea v
=== RUN   TestPullMerge
[Macaron] 2017-06-10 12:15:55: Started GET  for 
[Macaron] 2017-06-10 12:15:55: Completed  200 OK in 3.314036ms
[Macaron] 2017-06-10 12:15:55: Started POST  for 
[Macaron] 2017-06-10 12:15:55: Completed  302 Found in 28.692161ms
[Macaron] 2017-06-10 12:15:55: Started GET  for 
2017/06/10 12:15:55 [...ules/context/repo.go:209 func1()] [E] GetRepositoryByName: repository redirect does not exist [uid: 1, name: repo1]
[Macaron] 2017-06-10 12:15:55: Completed  404 Not Found in 6.389829ms
[Macaron] 2017-06-10 12:15:55: Started GET  for 
[Macaron] 2017-06-10 12:15:55: Completed  200 OK in 183.768102ms
[Macaron] 2017-06-10 12:15:55: Started GET  for 
[Macaron] 2017-06-10 12:15:55: Completed  200 OK in 4.063705ms
[Macaron] 2017-06-10 12:15:55: Started POST  for 
[Macaron] 2017-06-10 12:15:55: Completed  302 Found in 103.904046ms
[Macaron] 2017-06-10 12:15:55: Started GET  for 
[Macaron] 2017-06-10 12:15:55: Completed  200 OK in 207.495342ms
[Macaron] 2017-06-10 12:15:55: Started GET  for 
[Macaron] 2017-06-10 12:15:56: Completed  200 OK in 207.359152ms
[Macaron] 2017-06-10 12:15:56: Started POST  for 
[Macaron] 2017-06-10 12:15:56: Completed  200 OK in 351.53824ms
[Macaron] 2017-06-10 12:15:56: Started GET  for 
[Macaron] 2017-06-10 12:15:56: Completed  200 OK in 163.403833ms
--- FAIL: TestPullMerge (1.28s)
        Error Trace:    editor_test.go:137
			pull_merge_test.go:13
	Error:  	Not equal: 
			expected: 302
			received: 200
		
        Error Trace:    editor_test.go:144
			pull_merge_test.go:13
	Error:  	Not equal: 
			expected: "Hello, World (Edited)\n"
			received: "# repo1\n\nDescription for repo1"
		
FAIL
 ~/w/go/code.gitea.io/gitea  ⑂ pr1923 +    git log
commit 9029aafb885f90defd12c4e1f900300540ce9dbf
Author: Mura Li <[email protected]>
Date:   Tue Jun 6 17:25:37 2017 +0800

    Add integration test for pull-request merge

commit 23d0735f906498ca273b7cac399e9c8f0a0f08e8
Author: Ethan Koenig <[email protected]>
Date:   Fri Jun 9 22:27:13 2017 -0400

    Absolute path for setting.CustomConf

commit e9b1b908ee7c5b0722f6bce51aef4519990fae0b
Author: Ethan Koenig <[email protected]>
Date:   Fri Jun 9 14:13:46 2017 -0400

    Fix setting.AppPath for integration tests

@ethantkoenig
Copy link
Member Author

@typeless I said it fixed #1910, not #1912 😄

@ethantkoenig
Copy link
Member Author

But #1912 passes for me when I run it locally with these changes

@typeless
Copy link
Contributor

typeless commented Jun 11, 2017

@ethantkoenig Did you have a built gitea binary in $GITEA_ROOT?

@ethantkoenig
Copy link
Member Author

@typeless Yes, that is the point of the $GITEA_ROOT variable

@typeless
Copy link
Contributor

@ethantkoenig Nice. Then I can confirm the problem has been fixed as well. 👍

@typeless
Copy link
Contributor

By the way, IIRC the path package handles only slashes (mainly for URLs) and Windows paths are not supported. You might have to use filepath instead.

@lunny
Copy link
Member

lunny commented Jun 11, 2017

LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 11, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Jun 13, 2017

LGTM

@bkcsoft
Copy link
Member

bkcsoft commented Jun 13, 2017

make LG-TM work

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 13, 2017
@bkcsoft bkcsoft merged commit 889409b into go-gitea:master Jun 13, 2017
@ethantkoenig ethantkoenig deleted the fix/integration_test branch June 13, 2017 02:26
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug type/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrations.test is erroneously used as the hook in pre-receive.d of a forked repo in integration testing
5 participants